proc deop {nick chan host otbn1 botnet handle} {
global botnick home bcast
if {![botisop $chan]} {
  putquick "NOTICE $nick :\0034ERROR - Bot dosen't have op status (+o) on $chan"
  return 0
  }
if {$otbn1 == "$nick"} {
if {![isop $nick $chan]} {
  putquick "NOTICE $nick :Not Op'd - You are currently not op'd on $chan"
  return 0
  }
  putlog "!$nick ($host)! deop $chan $nick"
  putquick "MODE $chan -o $nick"
  putquick "NOTICE $nick :Sucessfully Deop'd $nick on $chan"
  if {$bcast == "1"} {
  putquick "PRIVMSG $home :Deop'd \002$nick\002 ($host) In $chan"
  }
  return 0
  }
if {$otbn1 == ""} { 
  set otbn1 $nick
if {![isop $nick $chan]} {
  putquick "NOTICE $nick :\0034ERROR Not Op'd - You are currently not op'd on $chan"
  return 0
  } 
  putlog "!$nick ($host)! deop $chan $nick"
  putquick "MODE $chan -o $nick"
  putquick "NOTICE $nick :Sucessfully Deop'd $nick on $chan"
if {$bcast == "1"} {
  putquick "PRIVMSG $home :Deop'd \002$nick\002 ($host) In $chan"
  }
  return 0
  }
if {![isop $botnet $chan]} {
  putquick "NOTICE $nick :\0034ERROR - Not Op'd - $botnet is currently not op'd on $chan"
  return 0
  } else {
if {[onchan $botnet $chan]} {
  set hand2 [nick2hand $botnet $chan]
if {[string tolower $botnet] == [string tolower $botnick]} {
  putquick "NOTICE $nick :\0034ERROR - Unable To Deop Services - Permission Denied."
  return 0
  }
if {[checkaccess $handle $chan $hand2]} {
  putlog "!$nick ($host)! deop $chan $botnet"
  pushmode $chan -o $botnet
  putquick "NOTICE $nick :Sucessfully deop'd $botnet on $chan"
if {$bcast == "1"} {
  putquick "PRIVMSG $home :Deop'd \002$botnet\002 in $chan.(Requested by: \002$nick\002 ($host))"
  }
  } else {
  putquick "NOTICE $nick :Unable To Execute Command - Not Enough Permissions - Permission Denied"
if {$bcast == "1"} {
  putquick "PRIVMSG $home :\002$nick\002 ($host) tried to make me deop $botnet on $chan but they are a higher level."    
  }
  return 0
  }
  }
  }
  }









